package com.didispace.condition;

import org.springframework.context.annotation.Condition;
import org.springframework.context.annotation.ConditionContext;
import org.springframework.core.type.AnnotatedTypeMetadata;

/**
 * Created by kerryf on 2017/6/23.
 */
public class LinuxCondition implements Condition {

	/**
	 * 这里写自己的逻辑，只有返回true，才会启用配置
	 */
	public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata)
	{
		return context.getEnvironment().getProperty("os.name").contains("Linux");
	}
}
